package com.ys.nms.module.business.dal.mysql.portsVlans;

import java.util.*;

import com.ys.nms.framework.common.pojo.PageResult;
import com.ys.nms.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.ys.nms.framework.mybatis.core.mapper.BaseMapperX;
import com.ys.nms.module.business.dal.dataobject.portsVlans.PortsVlansDO;
import org.apache.ibatis.annotations.Mapper;
import com.ys.nms.module.business.controller.admin.portsVlans.vo.*;

/**
 * ports_vlans Mapper
 *
 * @author zzy
 */
@Mapper
public interface PortsVlansMapper extends BaseMapperX<PortsVlansDO> {

    default PageResult<PortsVlansDO> selectPage(PortsVlansPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<PortsVlansDO>()
                .eqIfPresent(PortsVlansDO::getDeviceId, reqVO.getDeviceId())
                .eqIfPresent(PortsVlansDO::getPortId, reqVO.getPortId())
                .eqIfPresent(PortsVlansDO::getVlan, reqVO.getVlan())
                .eqIfPresent(PortsVlansDO::getBaseport, reqVO.getBaseport())
                .orderByDesc(PortsVlansDO::getPortVlanId));
    }

}